Optimal. Leaf size=322 \[ -\frac{2 a b \sin (e+f x) \cos ^2(e+f x)^{\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-2),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac{a^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-3),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac{b^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-1),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.559336, antiderivative size = 322, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {3948, 3869, 2824, 3189, 429} \[ -\frac{2 a b \sin (e+f x) \cos ^2(e+f x)^{\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-2),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac{a^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-3),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2}+\frac{b^2 \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (n p-1)} \left (c (d \sec (e+f x))^p\right )^n F_1\left (\frac{1}{2};\frac{1}{2} (n p-1),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3948
Rule 3869
Rule 2824
Rule 3189
Rule 429
Rubi steps
\begin{align*} \int \frac{\left (c (d \sec (e+f x))^p\right )^n}{(a+b \sec (e+f x))^2} \, dx &=\left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac{(d \sec (e+f x))^{n p}}{(a+b \sec (e+f x))^2} \, dx\\ &=\left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac{\cos ^{2-n p}(e+f x)}{(b+a \cos (e+f x))^2} \, dx\\ &=\left (\cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac{b^2 \cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}-\frac{2 a b \cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2}+\frac{a^2 \cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2}\right ) \, dx\\ &=\left (a^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac{\cos ^{4-n p}(e+f x)}{\left (-b^2+a^2 \cos ^2(e+f x)\right )^2} \, dx-\left (2 a b \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac{\cos ^{3-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx+\left (b^2 \cos ^{n p}(e+f x) \left (c (d \sec (e+f x))^p\right )^n\right ) \int \frac{\cos ^{2-n p}(e+f x)}{\left (b^2-a^2 \cos ^2(e+f x)\right )^2} \, dx\\ &=-\frac{\left (2 a b \cos ^2(e+f x)^{\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (2-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac{\left (a^2 \cos ^{n p+2 \left (\frac{1}{2}-\frac{n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac{1}{2}+\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (3-n p)}}{\left (a^2-b^2-a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}+\frac{\left (b^2 \cos ^{n p+2 \left (\frac{1}{2}-\frac{n p}{2}\right )}(e+f x) \cos ^2(e+f x)^{-\frac{1}{2}+\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (1-n p)}}{\left (-a^2+b^2+a^2 x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=-\frac{2 a b F_1\left (\frac{1}{2};\frac{1}{2} (-2+n p),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac{n p}{2}} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac{a^2 F_1\left (\frac{1}{2};\frac{1}{2} (-3+n p),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}+\frac{b^2 F_1\left (\frac{1}{2};\frac{1}{2} (-1+n p),2;\frac{3}{2};\sin ^2(e+f x),\frac{a^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{\frac{1}{2} (-1+n p)} \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{\left (a^2-b^2\right )^2 f}\\ \end{align*}
Mathematica [B] time = 32.8527, size = 10678, normalized size = 33.16 \[ \text{Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.154, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( c \left ( d\sec \left ( fx+e \right ) \right ) ^{p} \right ) ^{n}}{ \left ( a+b\sec \left ( fx+e \right ) \right ) ^{2}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{b^{2} \sec \left (f x + e\right )^{2} + 2 \, a b \sec \left (f x + e\right ) + a^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (c \left (d \sec{\left (e + f x \right )}\right )^{p}\right )^{n}}{\left (a + b \sec{\left (e + f x \right )}\right )^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n}}{{\left (b \sec \left (f x + e\right ) + a\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]